package me.boot.auth.spring.propertites;


import lombok.Getter;
import me.boot.auth.spring.AuthMode;
import org.apache.commons.compress.utils.Lists;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

@Getter
@ConfigurationProperties(prefix = AuthProperties.PREFIX)
public class AuthProperties {
    public final static String PREFIX = "auth";
    public final static String LOGIN_PAGE = "/login";
    public final static String LOGOUT_PAGE = "/logout";

    /**
     * 认证模式
     */
    private AuthMode authMode = AuthMode.RBAC;
    /**
     * 用户口令加密算法
     */
    private PasswordAlgorithm passwordAlgorithm = PasswordAlgorithm.bcrypt;

    /**
     * 最大并发登录数量
     */
    private Integer maximumSessions = Integer.MAX_VALUE;

    /**
     * 登录接口的api地址
     */
    private String loginPage = LOGIN_PAGE;
    /**
     * 注销接口的api地址
     */
    private String logoutPage = LOGOUT_PAGE;
    /**
     * 需要放入白名单（无需认证和授权）的url
     */
    private List<String> ignoreUrls = Lists.newArrayList();
}


